var reverseList = function(head){
  let pre = null;
  let curr = head;
  while(curr.next !== null){
    [pre,curr,curr.next]=[curr,curr.next,pre]
  }
  return pre
}